| API Documentation |  |

- MAIN PAGE
- NAMESPACES
- CLASSES

Public Member Functions | List of all members
nkWinUi::InputSystem Class Referencefinal

Input system, centralizing default behaviour for the input. More...

Inheritance diagram for nkWinUi::InputSystem:

## Public Member Functions
void | registerToTrack (EVENT_TYPE eventType, Component *component)
void | unregisterTracking (EVENT_TYPE eventType, Component *component)
void | requestWindowFollow (Component *caller, bool value)
std::function< bool(Component *)> | getCloseCallback () const
std::function< void(Component *, bool)> | getVisibilityCallback () const
std::function< void(Component *, const ClickEventData &)> | getClickCallback () const
std::function< void(Component *, const WheelEventData &)> | getWheelCallback () const
std::function< void(Component *, const KeyEventData &)> | getKeyCallback () const
const std::unordered_map< Component *, std::pair< bool, bool > > & | getFollowedWindows () const
void | setCloseCallback (std::function< bool(Component *caller)> callback)
void | setVisibilityCallback (std::function< void(Component *caller, bool visibility)> callback)
void | setClickCallback (std::function< void(Component *caller, const ClickEventData &eventData)> callback)
void | setWheelCallback (std::function< void(Component *caller, const WheelEventData &eventData)> callback)
void | setKeyCallback (std::function< void(Component *caller, const KeyEventData &eventData)> callback)

## Detailed Description

Input system, centralizing default behaviour for the input.

## Member Function Documentation

## ◆ registerToTrack()

void nkWinUi::InputSystem::registerToTrack | ( | EVENT_TYPE | eventType,
|  | Component * | component
| ) |  |

Register a component for it to listen to events of some kind even if not focused.

Parameters

  eventType | The type of event to listen to.
  component | The component needing to listen.

## ◆ unregisterTracking()

void nkWinUi::InputSystem::unregisterTracking | ( | EVENT_TYPE | eventType,
|  | Component * | component
| ) |  |

Unregister a component from listening to an event kind.

Parameters

  eventType | The type of event the component needs to stop listening to.
  component | The component needing to stop following the events.

## ◆ requestWindowFollow()

void nkWinUi::InputSystem::requestWindowFollow | ( | Component * | caller,
|  | bool | value
| ) |  |

Requests a tracking to know when a mouse is leaving a component.

Parameters

  caller | The component that needs to follow the mouse leaving it.
  value | If the tracking needs to occur (true) or not (false).

## ◆ getCloseCallback()

std::function<bool (Component*)> nkWinUi::InputSystem::getCloseCallback | ( |  | ) | const

Returns
  Currently set global close callback.

## ◆ getVisibilityCallback()

std::function<void (Component*, bool)> nkWinUi::InputSystem::getVisibilityCallback | ( |  | ) | const

Returns
  Currently set global visibility change callback.

## ◆ getClickCallback()

std::function<void (Component*, const ClickEventData&)> nkWinUi::InputSystem::getClickCallback | ( |  | ) | const

Returns
  Currently set global mouse click callback.

## ◆ getWheelCallback()

std::function<void (Component*, const WheelEventData&)> nkWinUi::InputSystem::getWheelCallback | ( |  | ) | const

Returns
  Currently set global mouse wheel callback.

## ◆ getKeyCallback()

std::function<void (Component*, const KeyEventData&)> nkWinUi::InputSystem::getKeyCallback | ( |  | ) | const

Returns
  Currently set global keyboard key callback.

## ◆ getFollowedWindows()

const std::unordered_map<Component*, std::pair<bool, bool> >& nkWinUi::InputSystem::getFollowedWindows | ( |  | ) | const

Returns
  The currenty memory for windows followed for cursor exit.

## ◆ setCloseCallback()

void nkWinUi::InputSystem::setCloseCallback | ( | std::function< bool(Component *caller)> | callback | ) |

Sets the global UI component close callback to use. This function will be the fallback for all components not having a dedicated callback.

Parameters

  callback | The callback to use.

## ◆ setVisibilityCallback()

void nkWinUi::InputSystem::setVisibilityCallback | ( | std::function< void(Component *caller, bool visibility)> | callback | ) |

Sets the global UI visibility change callback to use. This function will be the fallback for all components not having a dedicated callback.

Parameters

  callback | The callback to use.

## ◆ setClickCallback()

void nkWinUi::InputSystem::setClickCallback | ( | std::function< void(Component *caller, const ClickEventData &eventData)> | callback | ) |

Sets the global mouse click callback to use. This function will be the fallback for all components not having a dedicated callback.

Parameters

  callback | The callback to use.

## ◆ setWheelCallback()

void nkWinUi::InputSystem::setWheelCallback | ( | std::function< void(Component *caller, const WheelEventData &eventData)> | callback | ) |

Sets the global mouse wheel callback to use. This function will be the fallback for all components not having a dedicated callback.

Parameters

  callback | The callback to use.

## ◆ setKeyCallback()

void nkWinUi::InputSystem::setKeyCallback | ( | std::function< void(Component *caller, const KeyEventData &eventData)> | callback | ) |

Sets the global keyboard key callback to use. This function will be the fallback for all components not having a dedicated callback.

Parameters

  callback | The callback to use.

The documentation for this class was generated from the following file:

- Documentation/Headers/NilkinsWinUi/Inputs/InputSystem.h